using System.Web.UI;
using Microsoft.SharePoint.WebPartPages;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.SharePoint;
using System.Web;

namespace Macaw.Moss2007.SeoSlugsSolution
{
    public class SeoSlugsCreatePage_Adapter : System.Web.UI.Adapters.PageAdapter
    {
        // Fields
        //private static Regex ControlIdsRegex = new Regex("var\\surlNameTextBoxClientId\\s=\\s\"(?<urlNameTextBoxClientId>[^\"]+)\".*var\\stitleTextBoxClientId\\s=\\s\"(?<titleTextBoxClientId>[^\"]+)\"", RegexOptions.Singleline | RegexOptions.Compiled);

        // Methods
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            string localizedscriptname = string.Format("<script type=\"text/javascript\" src=\"/_layouts/Macaw.Moss2007.SeoSlugsSolution/SeoSlugs.{0}.js\"></script>", System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
            LiteralControl child = new LiteralControl(localizedscriptname);
            base.Page.Header.Controls.Add(child);
        }

    }
}